/*******************************************************************************
  * Copyright(c) 2023 Levetop Semiconductor Co.,Led. All rights reserved.   
  * @file     module_select.h
  * @author   UartTFT Application Team
  * @version  V0.0.1
  * @date     2023-01-07
  * @brief    This file contains the macro definitions that can be modified
  *            on the UartTFT Application.
********************************************************************************/ 

#ifndef _MODULE_SELECT_H
#define _MODULE_SELECT_H

// screen
#define	LT_TFT_COLOR	0		// TFT interface color format: 0:16bit/pixel(RGB565)  1:24bit/pixel(RGB888)(unsupported)
#define	LT_TFT_PORT		0		// TFT MCU interface mode: 0:4-line 8bit SPI  1:8080-8bit  2:8080-16bit(unsupported)
#define LT_TFT_DIR		1       // TFT direction: 0:vertical screen mode  1:horizontal screen mode	



// peripheral
#define LT_TOUCH_FLAG		2 		// touch panel type: 0:Null  1:RTP  2:CTP
#define LT_TOUCH_BUZZER		0 		// buzzer feedback on touch: 0:disable  1:enable
#define LT_ENCODER			1 		// encoder: 0:disable  1:enable
#define LT_SD_UPDATE		1 		// SDcard update: 0:disable  1:enable

// UI
#define	LT_PIC_BYTE_SWAP    0		// 16bit picture byte swap(unsupported)

// debug
#define UART_DEBUG			0		// uart printf port for debug: 0:SCI3  1:SCI1(custom)

// communication
#define UARTBUS_OPTION		0		// communication, 0:uart(SCI3) using Levetop protocol.
									//				  1:uart(SCI3) using Modbus protocol slave mode.
									//   			  2:uart(SCI3) using Modbus protocol host mode.
									//   			  3:iic using Levetop protocol.
									//   			  4:spi using Levetop protocol.
									//   			  5:USB_HID. (3)
									//   			  6:USB_CDC. (4)



//---------------------------------variable area-------------------------------------------------
#define VAR_ADDR		(0x2000)			    // var address
#define VAR_ADDR_S	    (VAR_ADDR)	            // var start address
#define VAR_ADDR_E	    (VAR_ADDR +0xFF)	    // var end address
#define VAR_SIZE	    ((VAR_ADDR +0xFF)*2)	// var and reg total size

#define VAR_PAGE		(VAR_ADDR +0x00)	// page
#define VAR_BL			(VAR_ADDR +0x01)	// backlight: brightness during operation
#define VAR_TIME		(VAR_ADDR +0x02)	// time
#define VAR_TIMESET		(VAR_ADDR +0x08)	// time setting
#define VAR_RSIZE_9		(VAR_ADDR +0x09)	// null
#define VAR_WAV			(VAR_ADDR +0x0a)	// wav
#define VAR_VOLUME		(VAR_ADDR +0x0b)	// sound volume
#define VAR_RTP			(VAR_ADDR +0x0c)	// resistance touch screen
#define VAR_KEY			(VAR_ADDR +0x0d)	// key code trigger
#define VAR_BLAUTO		(VAR_ADDR +0x0e)	// backlight: auto flag
#define VAR_BLSLEEP		(VAR_ADDR +0x0f)	// backlight: brightness during sleep
#define VAR_BLDURATION	(VAR_ADDR +0x10)	// backlight: duration during operation
#define VAR_MCURESET	(VAR_ADDR +0x11)	// 
#define VAR_MTLANGUAGE	(VAR_ADDR +0x3F)	// multi language
#define VAR_UI_CHANGE	(VAR_ADDR +0x40)	// change ui
#define VAR_TFT_TEST	(VAR_ADDR +0x41)	// TFT TEST
#define VAR_UI_UPDATE	(VAR_ADDR +0x42)	// ui update mode
#define VAR_ENCODER_C	(VAR_ADDR +0x43)	// encoder function control


#define VAR_MODBUS    	((VAR_ADDR +0xFF))	// Modbus COMMREQ save after VAR_SIZE on var(uart.c MODBUS_ADDR)

//---------------------------------reg area-------------------------------------------------
#define VAR_REG_S		(0x7000)				// reg start address
#define VAR_REG_E		(VAR_REG_S+0xFF)		// reg end address

#define VAR_CURVE_WS	(0xC001)	// curve write
#define VAR_CURVE_WE	(0xCFFF)	// curve write
#define VAR_CURVE_CS	(0xE001)	// curve clear
#define VAR_CURVE_CE	(0xEFFF)	// curve clear

//---------------------------------widget-------------------------------------------------
#define PAGECFG_SIZE	3072
#define DATA_WLEN_SIZE	30
#define PDATA_WLEN_SIZE	30
#define STRLEN_SIZE		300

#define BASIC_SIZE			20			// basic touch control
#define ADJUST_SIZE			10			// variable adjustment
#define SLIDE_SIZE			4			// slide progress bar adjustment
#define DIO_SIZE		  	20			// data keyboard
#define KEYBOARD_SIZE		60			// keyboard touch count
#define AIO_SIZE		  	10			// ascii keyboard
#define GBKIO_SIZE			10			// gbk keyboard
#define BATCH_SIZE			20			// multivariable adjustment
#define POPUP_SIZE			8			// pop-up window
#define GIF_SIZE			20			// gif               // default 8 
#define RTC_SIZE		  	6			// digital clock
#define CLOCK_SIZE			2			// analog clock 
#define SCROLL_SIZE			4			// text scroll
#define CURVE_SIZE			8			// curve 
#define SLDMENU_SIZE		6			// slide menu
#define RINGSLD_SIZE		4		  	// ring progress bar touch
#define COUNT_SIZE			10			// counter 
#define Var_count_size	15 //4


#endif	/* _MODULE_SELECT_H */
